from ultralytics import YOLO
import os

os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"

if __name__ == "__main__":

    #
    # model_path = r"E:\zhihao\2025文档\25年10月\ai_训练\权重\服务器上的权重\elevator_motor.pt"
    model_path = r"E:\zhihao\2025文档\25年10月\ai_训练\权重\服务器上的权重\ele_car_best.pt"
    valid_yaml = r"E:\zhihao\2025文档\25年10月\ai_训练\验证集\fire\elevator_safety\data.yaml"

    # Load the model
    model = YOLO(model_path)

    # Run the evaluation
    # 验证精度
    results = model.val(data=valid_yaml, classes=[0],  conf=0.7,iou=0.5, batch=9)
    # 验证测试
    # results = model.predict(data=valid_yaml, classes=[0], iou=0.3, batch=9)
